<template>
  <a-modal
    :title="modalTitle"
    :width="1200"
    :visible="visible"
    class="ant-modal2"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="2">
      <detail-list-item term="编号">{{ model.no }}</detail-list-item>
      <detail-list-item term="分析时间">{{ model.analyzeTime }}</detail-list-item>
      <detail-list-item term="故障部位">{{ model.sbPartName }}</detail-list-item>
    </detail-list>

    <title-divider title="故障现象" width="120px"></title-divider>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="content">{{ model.problemDesc }}</div>
      </a-col>
    </a-row>
    <title-divider title="检查处理过程" width="120px"></title-divider>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="content">{{ model.checkProcess }}</div>
      </a-col>
    </a-row>
    <title-divider title="原因分析" width="120px"></title-divider>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="content">{{ model.reasonAnalysis }}</div>
      </a-col>
    </a-row>
    <title-divider title="改进措施" width="120px"></title-divider>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="term">更新备件计划:</div>
        <div class="content">{{ model.changeSparePlanContent }}</div>
      </a-col>
    </a-row>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="term">更新备件计划:</div>
        <div class="content">{{ model.changeSparePlanContent }}</div>
      </a-col>
    </a-row>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="term">人员培训:</div>
        <div class="content">{{ model.userTeachContent }}</div>
      </a-col>
    </a-row>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="term">设备改造升级:</div>
        <div class="content">{{ model.sbChangeContent }}</div>
      </a-col>
    </a-row>
    <a-row>
      <a-col style="margin-top: 10px">
        <div class="term">其他:</div>
        <div class="content">{{ model.otherChangeContent }}</div>
      </a-col>
    </a-row>
    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
    </template>
  </a-modal>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
const DetailListItem = DetailList.Item

export default {
  name: 'RepairReasonDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      typeMap: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'no': null,
        'sbId': null,
        'sbPartId': null,
        'sbPartName': null,
        'repairId': null,
        'analyzeTime': null,
        'problemDesc': null,
        'checkProcess': null,
        'reasonAnalysis': null,
        'changeRepairPlanContent': null,
        'changeSparePlanContent': null,
        'userTeachContent': null,
        'sbChangeContent': null,
        'otherChangeContent': null,
        'improveMeasure': null
      }
    }
  },
  created () {
    // 下拉框map
    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_STATUS)
    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
<style scoped>
  .term {
    color: rgba(0, 0, 0, .85);
    display: table-cell;
    line-height: 20px;
    margin-right: 8px;
    padding-bottom: 16px;
    white-space: nowrap;
  }
</style>
